package br.com.hotel.controller;

import java.util.ArrayList;
import java.util.List;

import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;

import org.apache.catalina.manager.util.SessionUtils;
import org.hibernate.impl.SessionFactoryImpl;

import br.com.hotel.dao.DiariaDAO;
import br.com.hotel.dao.ServiceEstadiaDAO;
import br.com.hotel.entity.Cliente;
import br.com.hotel.entity.Diaria;
import br.com.hotel.entity.Estadia;
import br.com.hotel.entity.ServiceEstadia;

public class FaturaJSF {
	private Estadia e;
	
	public FaturaJSF() {
		
	}
	
	
	public Estadia getE() {
		return e;
	}


	public void setE(Estadia e) {
		this.e = e;
	}


	public List<ServiceEstadia> getAllServiceEstadia() throws ClassNotFoundException{
		ServiceEstadiaDAO c = new ServiceEstadiaDAO();
		List<ServiceEstadia> l = c.getServiceEstadias(e.getId());
		return (l);
	}
	
	public DataModel<Estadia> getGastoDiaria() throws ClassNotFoundException{
		DiariaDAO c = new DiariaDAO();
		
		List<Estadia> l = new ArrayList<Estadia>();
		
		l.add(e);
		return (DataModel<Estadia>)(new ListDataModel<Estadia>(l));
	}
	public Cliente cliente(){
		
		System.out.println("Teste"+e);
		return e.getCliente();
	}
	
}
